#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
    pid_t pid;

    /* Remove the defunc pid in process table */

    while(1)
    {
	switch(pid=fork())
	{
	    case -1:
		printf("Fork failured!\n");
		break;
	    case 0:
		printf("This is child thread!\n");
		_exit(0);
		break;
	    default:
		printf("Child process %d created!\n", pid);
		sleep(10);
		break;
	}
    }
} 
